package service

import (
	"ylb/config"
	"ylb/tool"
)

func GetEmailRegisterCodeKey(email string) string {
	return config.EMAILREGISTERCODE + ":" + email
}
func GetEmailRegisterCode(email string) (string, error) {
	key := GetEmailRegisterCodeKey(email)

	connection := tool.GetRedisConnection()
	defer connection.Close()

	result, err := connection.Get(key).Result()
	if err == nil {
		connection.Del(key)
	}
	return result, err
}
